package com.smallmanager.util;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

public class SmallEditText extends EditText {
	private Context mContext;

	public SmallEditText(Context context) {
		super(context);
		mContext = context;
	}
	
	public SmallEditText(Context context, AttributeSet attrs, int defStyle) {  
        super(context, attrs, defStyle);  
        mContext = context;  
    }  
  
    public SmallEditText(Context context, AttributeSet attrs) {  
        super(context, attrs);  
        mContext = context;  
    }  
	@Override
	protected void onFocusChanged(boolean focused, int direction,
			Rect previouslyFocusedRect) {
		super.onFocusChanged(focused, direction, previouslyFocusedRect);
		if(!focused){
			InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE); 
			imm.hideSoftInputFromWindow(this.getWindowToken(), 0); 
		}
		
	}

}
